Skip to Content
ProTemplates

Atelier, Pro

The workspace a studio or agency runs on, for Next.js. Install it into a new project, then rewrite its sample API to read your own projects, time, invoices and clients.

Atelier is a whole app made of Dashboardblocks blocks: the workspace a design or development studio runs on. Home is a board of cards each person arranges, with the month's revenue against its goal, their day and the team's week; Inbox, Calendar and Tasks hold what waits on each person; Pipeline, Invoices, Projects and Clients follow the work from a deal to a paid invoice, with each project's budget against its hours; People shows who is booked on what, Time holds each week's timesheet and those to approve; and Reports and Settings run the studio. Every page reads and writes through one sample API, so the app works as soon as it's installed. Open the preview to try it first.

Install

Atelier comes with All-Access and installs with the shadcn CLI.

  1. Make a Next.js project with shadcn set up, at shadcn create (opens in a new tab) or with the CLI:

    npx shadcn@latest init --template next
  2. Add the @dashboardblocks-pro registry and your token, as Installation shows.

  3. Install Atelier:

    npx shadcn@latest add @dashboardblocks-pro/atelier-next --overwrite
  4. Run npm run dev and open /home.

With --overwrite, the CLI replaces any file you have that Atelier also ships, such as shadcn components and blocks you've changed and a proxy.ts, so commit first and check the diff. Without it, the CLI asks about each of those files, and skips them all when it can't ask. Your root layout, home page and theme stay as they are, and Atelier takes your shadcn style, component library and icon set.

What it adds

PathWhat's there
app/(atelier)/The routes. Each one loads its page's data from the sample API and passes it to the page.
components/atelier/pages/A component per page. They take data and callbacks as props and know nothing about Next.js.
lib/atelier/api/The sample API: async functions in index.ts and the files beside it, their types in types.ts, and Northlight's people, projects, bookings, time, deals, invoices and clients in data/.
components/atelier/next/The layout, the session, the proxy, and the Server Actions each page calls.
components/atelier/routes.tsThe list of pages that the sidebar and search read, and which roles may open each.
components/atelier/The parts every page shares: the app shell, the logo, the link adapter, Home's cards, and the parts several pages share.
proxy.tsRuns Atelier's proxy on its pages.

In a project with a src/ folder, they go in src/. The blocks Atelier uses install next to your other blocks in components/dashboardblocks/.

Use your own data

Pages never load data themselves. Each route file calls functions from lib/atelier/api, and each change goes through a Server Action that calls one too. To show your studio's work, rewrite the bodies of those functions and keep their types. The pages, routes and actions stay as they are.

  1. Start with the page you need first. Its route file in app/(atelier)/ names the functions it calls, such as getHome for Home.
  2. Rewrite each function to query your database and return the type types.ts gives it. A write returns a result the page shows, such as a refusal with its reason, so keep returning one.
  3. Once nothing reads data/ any more, delete it.

The sample's numbers agree across pages: Home's Outstanding is the invoices waiting on Invoices, a project's spend is its hours at its rate, and the open pipeline's weighted value is its deals at each stage's odds. Read each from the same records in your app and they keep agreeing.

Every read and write takes the session first and checks the signed-in person's role in lib/atelier/api: a read for a page their role can't open returns undefined, and a write they can't make is refused. Members open Home, Inbox, Calendar, Tasks, Projects, People and Time, see hours but no money, and fill in their own timesheet. Managers also open Pipeline, Invoices and Clients, see the money cards on Home, book people, approve time off and timesheets, change projects, deals and clients, and draft invoices. Only the owner opens Reports and Settings, sees cash in bank, margins and what each person costs, sends invoices and reminders, records payments, voids invoices, changes a project's budget and retainers, and manages people, apps and the plan. Keep those checks when you move a read or a write to your database.

Keep what people change

The sample API keeps its changes in the server's memory, in one copy every visitor shares, for as long as the server runs. Each person's Home board is kept apart, so everyone arranges their own. Your database replaces it: every write ends in keep in lib/atelier/api/sample.ts, so save the change there and have the reads read it back, on every server. The notifications each person has read are in a cookie (components/atelier/next/session.ts); keep them on their account in your app.

Invoices, email and apps

Sending an invoice or a reminder only records it in the sample: nothing is emailed. Send the email, or hand the invoice to your accounting app, where sendInvoice, createInvoice with send, and sendInvoiceReminder record one. Invites (inviteMembers, resendInvite), timesheet reminders (remindTimesheet) and replies from Inbox (replyToInboxItem) are recorded the same way. An invoice shows when its next reminder is due, and next month's retainer invoices wait as scheduled drafts, so send both from a daily job in your app.

Settings' Apps links Xero or QuickBooks, Stripe and Google Calendar. runAppAction connects and disconnects them in the sample; its doc comment says where your app sends the owner to sign in to the service and saves its token. While Stripe is connected, each invoice carries the pay link set in Settings. While Google Calendar isn't syncing, the pages that show meetings say some may be missing.

Plan and billing is Atelier's own plan for the studio: a seat for everyone with a sign-in and every invite waiting. changePlan, cancelPlan, resumePlan and updateCard change the sample's plan. updateCard says in its doc comment where your payment provider's card form goes, so a card number never reaches your server.

Add your auth

components/atelier/next/session.ts tells every page whether someone is signed in and who they are. For now Elena Marsh, Northlight's owner, is signed in until she signs out. Change isSignedOut and getSession to read your auth library's session, and set memberId to the signed-in person's id. getSession already returns null for someone who isn't one of the studio's people (isInStudio), and the sample API reads each person's role from memberRoles in data/studio.ts. Once your people come from your database, make isInStudio and the role read it too. Until you change getSession, everyone who signs in is Elena.

The /sign-in and /sign-out routes in proxy.ts stand in for your auth library's own. Once you add yours, take them out of its matcher and out of components/atelier/next/proxy.ts, and point the sign-in and sign-out links at your library's pages: they're in components/atelier/next/next-shell.tsx.

If you had a proxy.ts before, put yours back and call atelierProxy(request) from components/atelier/next/proxy.ts for the paths in the matcher of the one Atelier installed.

Logos

The logos of Xero, QuickBooks, Stripe and Google Calendar belong to them. Atelier shows them on Settings' Apps to name the services the studio links to. Check each one's brand guidelines before you change how they're shown.

On this page