System Requirements
Before installing App CR, ensure your system meets these requirements:Node.js
Version 14.x or higher
Docker
Docker Engine 20.x+ and Docker Compose
PostgreSQL
Version 15 (via Docker) or existing instance
Git
For cloning the repository
Installation Methods
- Docker (Recommended)
- Existing PostgreSQL
Use Docker for the easiest setup with isolated database.Verify the container is running:Create a
Step 1: Clone the Repository
Step 2: Review Docker Configuration
The includeddocker-compose.yml configures PostgreSQL:The volume
postgres_data persists your database data between container restarts.Step 3: Start PostgreSQL
Step 4: Configure Backend
Navigate to the backend directory:.env file:Step 5: Install Dependencies
Step 6: Setup Database
Step 7: Start the Server
Configuration
Environment Variables
App CR uses the following environment variables:| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | Yes | - | PostgreSQL connection string |
JWT_SECRET | Yes | - | Secret key for signing JWT tokens |
PORT | No | 3000 | Port for the Express server |
Database URL Format
TheDATABASE_URL follows this format:
JWT Configuration
TheJWT_SECRET is used to sign authentication tokens. Choose a strong, random string:
Database Schema
App CR uses Prisma ORM with the following schema:Running Migrations
When you modify the schema, generate and apply migrations:Dependencies
App CR includes these core dependencies:Updating Dependencies
Keep dependencies up to date:Server Configuration
The Express server is configured inbackend/index.js:
CORS Configuration
CORS is enabled by default for all origins. For production, restrict origins:Port Configuration
Change the server port via environment variable or directly:Database Tools
Prisma Studio
Visual database browser:http://localhost:5555 for viewing and editing data.
Database Seeding
Create a seed scriptprisma/seed.js:
package.json:
Production Deployment
Verification
Verify your installation:Check Server Health
Check Server Health
Test Database Connection
Test Database Connection
View Logs
View Logs
Check server output for errors:
Troubleshooting
Module not found errors
Module not found errors
Ensure all dependencies are installed:
Database connection refused
Database connection refused
Check PostgreSQL is running:
Port already in use
Port already in use
Find and stop the process using the port:
Prisma client errors
Prisma client errors
Regenerate Prisma client:
Next Steps
API Reference
Explore available endpoints
Authentication
Implement JWT authentication