Docs
Quickstart
Quickstart
Get started in about 30 minutes by following these steps.
Preparation
-
Unpack the Archive
-
Switch to the project's root directory
cd achromatic-pro
- Install the node dependencies
npm install
- Copy the sample configuration
cp .env.example .env
Services
Database
- Install PostgreSQL via Homebrew, Chocolatey or download it from the website.
brew install postgresql
- Add an initial user.
sudo -u postgres psql
CREATE USER postgres WITH PASSWORD 'password';
ALTER USER postgres WITH SUPERUSER;
\q
- Update
.env
with your database credentials.
DATABASE_URL=postgresql://postgres:password@localhost:5432/achromatic_pro?schema=public
- Apply the database migrations.
npx prisma migrate dev
Google Login (Optional)
- Visit the Google Cloud Console.
- Create an account if you don't have one already.
- Navigate to APIs or click here
- Configure the
OAuth consent screen
and add yourself as test user. - Click on
Credentials
, create new OAuth credentials and save those credentials. - Add the Authorized JavaScript origin to the credential settings.
http://localhost:3000
- Add the Authorized redirect URI to the credential settings.
http://localhost:3000/api/auth/callback/google
- Update
.env
with the created credentials.
AUTH_GOOGLE_CLIENT_ID=
AUTH_GOOGLE_CLIENT_SECRET=
Microsoft Login (Optional)
- Visit the Azure Portal.
- Create an account if you don't have one already.
- Navigate to your Entra ID (Active Directory).
- Register a new application with platform web.
- Click on
Authentication
in the menu and add the redirect URIs
http://localhost:3000
http://localhost:3000/api/auth/callback/microsoft-entra-id
- Under
Certificates & Secrets
, create a new client secret. - Update
.env
with the created secret.
AUTH_MICROSOFT_ENTRA_ID_CLIENT_ID=
AUTH_MICROSOFT_ENTRA_ID_CLIENT_SECRET=
Stripe
- Visit the Stripe Dashboard.
- Create an account if you don't have one already.
- Activate test mode.
- Activate the customer billing portal.
- Create a product.
- Create a price for the product.
- Navigate to developer section and copy the API credentials.
- Update
.env
with the IDs and credentials.
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
PRO_PRODUCT_ID=
PRO_PRODUCT_PRICE_ID=
SMTP Provider
Achromatic supports both NodeMailer (SMTP) and Resend.
- Choose an email provider (Gmail for testing is fine).
- Update
.env
with your settings/credentials.
EMAIL_SENDER=noreply@mailer.mydomain.com # recommend to use subdomain for transactional/marketing emails
EMAIL_MAILER=NodeMailer # NodeMailer (default) | Resend
# NodeMailer
EMAIL_SERVER_HOST=
EMAIL_SERVER_PORT=
EMAIL_SERVER_USER=
EMAIL_SERVER_PASS=
# Resend
EMAIL_RESEND_API_KEY=
Note: For Gmail, you'll need to use an app-specific password. Follow Google's instructions to generate one. Here is an example:
EMAIL_SERVER_HOST=smtp.gmail.com
EMAIL_SERVER_PORT=465
EMAIL_SERVER_USER=example@gmail.com
EMAIL_SERVER_PASS=suyz yeba qtgv xrnp
Sending emails is mandatory for the credentials login.
Application
- Start the Application
npm run dev
- Navigate to http://localhost:3000
You’re all set to start!