|
1 | | -# Django + Next.js Template |
2 | | - |
3 | | -Django + Nextjs Template: Standardised CFC Tech Stack |
4 | | - |
5 | | ---- |
6 | | - |
7 | | -### Prerequisites |
8 | | - |
9 | | -- **Node.js 18+** and **npm** - [Download here](https://nodejs.org/) |
10 | | -- **uv 0.8+** (Python package manager) - [Installation guide](https://docs.astral.sh/uv/getting-started/installation/) |
11 | | - |
12 | | -### Installation Steps |
13 | | - |
14 | | -#### 1. Clone the Repository |
15 | | -```bash |
16 | | -git clone <your-repo-url> |
17 | | -cd <project-name> |
18 | | -``` |
19 | | - |
20 | | -#### 2. Install Prerequisites |
21 | | -**MacOS:** |
22 | | -```bash |
23 | | -brew install uv |
24 | | -``` |
25 | | -**Ubuntu** |
26 | | -```bash |
27 | | -apt install astral-uv |
28 | | -``` |
29 | | -Otherwise, look at the [installation guide](https://docs.astral.sh/uv/getting-started/installation/) |
30 | | -#### 3. Set Up Environment Variables |
31 | | -Before proceeding, create your environment files by copying the examples: |
32 | | -```bash |
33 | | -cp ./client/.env.example ./client/.env && cp ./server/.env.example ./server/.env |
34 | | -``` |
| 1 | +# LonkedIn : Not a Calendar |
35 | 2 |
|
36 | | -#### 4. Set Up the Backend (Django) |
37 | | -```bash |
38 | | -cd server |
39 | | -uv sync |
40 | | -source .venv/bin/activate |
41 | | -python manage.py migrate |
42 | | -python manage.py createsuperuser |
43 | | -python manage.py runserver |
44 | | -``` |
| 3 | +## Overview |
45 | 4 |
|
46 | | -**Backend (`.env` in `server/`)** |
47 | | -```env |
48 | | -APP_NAME=DjangoAPI |
49 | | -APP_ENV=DEVELOPMENT |
50 | | -API_SECRET_KEY=your-secret-key-here |
51 | | -API_ALLOWED_HOSTS=.localhost 127.0.0.1 [::1] |
| 5 | +LonkedIn is a streamlined task and time management system designed for students, employees, and anyone who likes to organise their time. |
52 | 6 |
|
53 | | -POSTGRES_HOST=localhost |
54 | | -POSTGRES_NAME=your_db_name |
55 | | -POSTGRES_USER=your_username |
56 | | -POSTGRES_PASSWORD=your_password |
57 | | -POSTGRES_PORT=5432 |
| 7 | +## Tasks |
58 | 8 |
|
59 | | -DJANGO_SUPERUSER_PASSWORD=Password123 |
60 | | -DJANGO_SUPERUSER_EMAIL=admin@test.com |
61 | | -DJANGO_SUPERUSER_USERNAME=admin |
| 9 | +Users can **create and manage** their tasks in a **to-do list fashion** on the **Tasks page**. Each task can be assigned a name and description, as well as a number of topics and times. |
62 | 10 |
|
63 | | -FRONTEND_URL=http://localhost:3000 |
64 | | -``` |
| 11 | +**Topics** denote what the task relates to and provides visual organiation between related tasks. **Times** denote a timeframe for working on this task throughout the week. |
65 | 12 |
|
66 | | -**Frontend (`.env` in `client/`)** |
67 | | -```env |
68 | | -NEXT_PUBLIC_BACKEND_URL=http://localhost:8000 |
69 | | -``` |
| 13 | + |
70 | 14 |
|
71 | | -#### 6. Set Up the Frontend (Next.js) |
72 | | -```bash |
73 | | -cd client |
74 | | -npm install |
75 | | -npm run dev |
76 | | -``` |
| 15 | +Users can add new tasks using the **Add Task** form. |
77 | 16 |
|
78 | | -#### 7. Verify Installation |
79 | | -- Frontend: [http://localhost:3000](http://localhost:3000) |
80 | | -- Backend API: [http://localhost:8000](http://localhost:8000) |
81 | | -- Admin panel: [http://localhost:8000/admin](http://localhost:8000/admin) |
| 17 | + |
82 | 18 |
|
83 | | ---- |
| 19 | +Users can also edit existing tasks by clicking the edit button in the top right of the task. |
84 | 20 |
|
85 | | -## Development Commands |
| 21 | + |
86 | 22 |
|
87 | | -### Backend (Django) |
88 | | -```bash |
89 | | -cd server |
| 23 | +## Schedule |
90 | 24 |
|
91 | | -# Run development server |
92 | | -python manage.py runserver |
| 25 | +Users can view their schedule on the **Schedule Page**, showing visually which tasks have been assinged to which times during the week. |
93 | 26 |
|
94 | | -# Create migrations |
95 | | -python manage.py makemigrations |
| 27 | + |
96 | 28 |
|
97 | | -# Apply migrations |
98 | | -python manage.py migrate |
| 29 | +Hovering over a task in the timetable will display more information about it. |
99 | 30 |
|
100 | | -# Create superuser |
101 | | -python manage.py createsuperuser |
| 31 | +## Focus |
102 | 32 |
|
103 | | -# Run tests |
104 | | -python manage.py test |
| 33 | +Finally, users can view the task scheduled for the current time, the time remaining on this task, as well as upcoming tasks. If there is no task scheduled for the current time the page will instead display the next upcoming task and a timer until it begins. |
105 | 34 |
|
106 | | -# Reset database (nuclear option) |
107 | | -./nuke.sh |
108 | | -``` |
109 | | - |
110 | | -### Frontend (Next.js) |
111 | | -```bash |
112 | | -cd client |
113 | | - |
114 | | -# Development server |
115 | | -npm run dev |
116 | | - |
117 | | -# Build for production |
118 | | -npm run build |
119 | | - |
120 | | -# Start production server |
121 | | -npm start |
122 | | - |
123 | | -# Run linting |
124 | | -npm run lint |
125 | | - |
126 | | -# Fix linting issues |
127 | | -npm run lint:fix |
128 | | - |
129 | | -# Type checking |
130 | | -npm run typecheck |
131 | | - |
132 | | -# Format code |
133 | | -npm run format |
134 | | -``` |
135 | | - |
136 | | ---- |
137 | | - |
138 | | -## Server |
139 | | - |
140 | | -### Create and run migrations |
141 | | - |
142 | | -If the models are updated, be sure to create a migration: |
143 | | - |
144 | | -```bash |
145 | | -python manage.py makemigrations # create migration |
146 | | -python manage.py migrate # apply migrations |
147 | | -``` |
148 | | - |
149 | | -### Nuke the DB |
150 | | - |
151 | | -If you run into migration conflicts that you can't be bothered to fix, run `nuke.sh` to clear your database. Then, run migrations again. |
152 | | - |
153 | | -## Other |
154 | | - |
155 | | -### Update Dependencies |
156 | | - |
157 | | -You can run `npm install` and `uv sync` in the respective `client` and `server` folders to install the newest dependencies. |
158 | | - |
159 | | -### Changing env vars |
160 | | - |
161 | | -Edit the `.env` file in the respective directory (client or server). |
| 35 | + |
0 commit comments