Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Django + Nextjs Template: Standardised CFC Tech Stack

The easiest way to get started is using the VS Code Dev Container:

1. **Prerequisites**:
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)
- [VS Code](https://code.visualstudio.com/)
1. **Prerequisites**:
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)
- [VS Code](https://code.visualstudio.com/)
- [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)

2. **Open in Dev Container**:
Expand All @@ -19,6 +19,7 @@ The easiest way to get started is using the VS Code Dev Container:
- When prompted, click "Reopen in Container" or use `Ctrl+Shift+P` → "Dev Containers: Reopen in Container"

3. **Start the application**:

```bash
# Terminal 1: Start the frontend
cd client && npm run dev
Expand All @@ -33,6 +34,7 @@ The easiest way to get started is using the VS Code Dev Container:
- Admin panel: [http://localhost:8000/admin](http://localhost:8000/admin)

---

## Local Development Setup

**Note**: Only follow these steps if you're NOT using the dev container.
Expand All @@ -47,6 +49,7 @@ The easiest way to get started is using the VS Code Dev Container:
### Installation Steps

#### 1. Clone the Repository

```bash
git clone <your-repo-url>
cd <project-name>
Expand All @@ -55,6 +58,7 @@ cd <project-name>
#### 2. Install Prerequisites

**Poetry (Python package manager)**

```bash
# Official installer (all OSes)
curl -sSL https://install.python-poetry.org | python3 -
Expand All @@ -72,11 +76,13 @@ cd server && docker compose up -d
#### 4. Set Up Environment Variables

Before proceeding, create your environment files by copying the examples:

```bash
cp ./client/.env.example ./client/.env && cp ./server/.env.example ./server/.env
```

**Backend (`.env` in `server/`)**

```env
APP_NAME=DjangoAPI
APP_ENV=DEVELOPMENT
Expand All @@ -97,28 +103,33 @@ FRONTEND_URL=http://localhost:3000
```

**Frontend (`.env` in `client/`)**

```env
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
```

#### 5. Set Up the Backend (Django)

```bash
cd server
poetry install
poetry shell
# POSIX shells
eval "$(poetry env activate)"
python manage.py migrate
python manage.py createsuperuser # optional
python manage.py runserver
```

#### 6. Set Up the Frontend (Next.js)

```bash
cd client
npm install
npm run dev
```

#### 7. Verify Installation

- Frontend: [http://localhost:3000](http://localhost:3000)
- Backend API: [http://localhost:8000](http://localhost:8000)
- Admin panel: [http://localhost:8000/admin](http://localhost:8000/admin)
Expand All @@ -128,6 +139,7 @@ npm run dev
## Development Commands

### Backend (Django)

```bash
cd server

Expand All @@ -151,6 +163,7 @@ python manage.py test
```

### Frontend (Next.js)

```bash
cd client

Expand Down Expand Up @@ -205,4 +218,5 @@ If you modify anything in the `docker` folder, you need to add the `--build` fla

### Changing env vars

Edit the `.env` file in the respective directory (client or server).
Edit the `.env` file in the respective directory (client or server).

34 changes: 11 additions & 23 deletions client/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,44 +1,32 @@
import { defineConfig } from "eslint/config";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import _import from "eslint-plugin-import";
import { fixupPluginRules } from "@eslint/compat";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
import nextPlugin from "@next/eslint-plugin-next";
import pluginQuery from "@tanstack/eslint-plugin-query";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import importX from "eslint-plugin-import-x";

export default defineConfig([
{
ignores: [".next/**", "node_modules/**"],
},
{
files: ["**/*.ts", "**/*.tsx"],
extends: compat.extends(
"plugin:@next/next/recommended",
"plugin:@tanstack/eslint-plugin-query/recommended",
),

plugins: {
"@next/next": nextPlugin,
"simple-import-sort": simpleImportSort,
import: fixupPluginRules(_import),
import: importX,
},

languageOptions: {
parser: tsParser,
},

rules: {
...nextPlugin.configs.recommended.rules,
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn",
"import/first": "warn",
"import/newline-after-import": "warn",
"import/no-duplicates": "warn",
},
},
...pluginQuery.configs["flat/recommended"],
]);
Loading
Loading