Skip to content

Commit c6d2396

Browse files
committed
Merge branch 'rework'
* rework: (35 commits) old: Add profile page Rename 'public' to 'old' public: Refactor old interface to keep up with new API settings/account: Add header 'change password' feat: add settings pages feat(sidebar-menu): add Roundcube link feat(ui): add radio-group ui chore(deps): upgrade bits-ui version chore(ui/avatar): add select-none for avatar fallback chore(sidebar-menu): add active menu style feat(ui): add avatar ui chore(schema): rename login schema refactor: update HTTP client, typings, and login method feat(typings/common): add disabled property for Navigations feat(constants): add settingsNav data chore(login): remove unnecessary default data fix(toaster): add Toaster component chore: update README.md chore(.gitignore): add patch files ignore feat(routes): add login page ... Signed-off-by: Ammar Faizi <[email protected]>
2 parents 0fd40f5 + dcaa59f commit c6d2396

File tree

169 files changed

+9930
-2317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+9930
-2317
lines changed

.gitignore

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
1+
# old ignore
12
*.o
23
*.so
34
*.swo
45
*.swp
56
*.log
67
*.tmp
78
*.lock
8-
/config.php
9+
/config.php
10+
11+
# node_modules
12+
node_modules
13+
14+
# Output
15+
.output
16+
.vercel
17+
.netlify
18+
.wrangler
19+
/.svelte-kit
20+
/build
21+
/dist
22+
23+
# OS
24+
.DS_Store
25+
Thumbs.db
26+
27+
# Env
28+
.env
29+
.env.*
30+
!.env.example
31+
!.env.test
32+
33+
# Vite
34+
vite.config.js.timestamp-*
35+
vite.config.ts.timestamp-*
36+
37+
# patch
38+
/patch
39+
*.patch

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Package Managers
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock

.prettierrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"useTabs": false,
3+
"singleQuote": false,
4+
"endOfLine": "lf",
5+
"trailingComma": "none",
6+
"printWidth": 100,
7+
"plugins": [
8+
"prettier-plugin-svelte",
9+
"prettier-plugin-tailwindcss"
10+
],
11+
"overrides": [
12+
{
13+
"files": "*.svelte",
14+
"options": {
15+
"parser": "svelte"
16+
}
17+
}
18+
]
19+
}

LICENSE

Lines changed: 0 additions & 339 deletions
This file was deleted.

README.md

Lines changed: 88 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,111 @@
1-
# Mail Service for GNUWeeb
1+
<h1 align="center">
2+
GNU/Weeb Mail
3+
</h1>
4+
5+
<h2 id="table-of-contents">
6+
Table of Contents
7+
</h2>
8+
9+
- [Requirements](#requirements)
10+
- [How to Run](#how-to-run)
11+
- [How to Build](#how-to-build)
12+
- [Code Standards](#code-standards)
13+
- [How to Develop or Contribute](#how-to-develop)
14+
15+
<h2 id="requirements">
16+
Requirements
17+
</h2>
18+
19+
- **NodeJS** version 18+,strongly recommended to use version 20+ as this project developed using **NodeJS** version 20+
20+
[Download](https://nodejs.org/en/download)
21+
- **TypeScript** version 5, no need to download in your OS as this project will install the TypeScript only inside this project.
22+
- Code Editor, of course, we recommend using your favorite IDE, for example, [VS Code](https://code.visualstudio.com/download).
23+
- Svelte 5 Runes knowledge.
24+
25+
<h2 id="how-to-run">
26+
How to Run
27+
</h2>
228

3-
## Requirements
4-
- PHP 7.4+
5-
- MySQL 5.5+
29+
```sh
30+
# install all dependencies before running this project
31+
npm i
32+
npm run dev
33+
```
34+
35+
<h2 id="how-to-build">
36+
How to Build
37+
</h2>
638

7-
## Setup Instructions (Ubuntu)
839
```sh
9-
sudo apt-get install libphp7.4-embed php7.4 php7.4-bcmath php7.4-bz2 php7.4-cgi php7.4-cli php7.4-common php7.4-curl php7.4-dba php7.4-dev php7.4-enchant php7.4-gd php7.4-gmp php7.4-imap php7.4-interbase php7.4-intl php7.4-json php7.4-ldap php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-snmp php7.4-soap php7.4-sybase php7.4-tidy php7.4-xml php7.4-xmlrpc php7.4-xsl php7.4-zip -y
40+
# install all dependencies before building this project
41+
npm i
42+
npm run build
43+
```
1044

11-
sudo apt-get install mysql-server -y;
45+
After build, the `dist` folder will be created, copy them to your own server, for example, [nginx](https://nginx.org/en/download.html).
1246

13-
# Check your MySQL version number
14-
mysql --version;
47+
<h2 id="code-standards">
48+
Code Standards
49+
</h2>
1550

16-
# Don't start mysql when boot (for local development only)
17-
sudo systemctl disable mysql;
51+
We use `LF` for each End of Line style and add empty newline for every End of File, you must setting all that in your IDE before contributing on this project.
1852

19-
# Start mysql
20-
sudo systemctl start mysql;
53+
<h2 id="how-to-develop">
54+
How to Develop or Contribute
55+
</h2>
2156

22-
git clone https://github.com/GNUWeeb/mail.gnuweeb.org;
23-
cd mail.gnuweeb.org;
24-
```
57+
<h3>Framework</h3>
58+
59+
If you are new to **SvelteKit** using the **Svelte 5 Runes**, we recommend to learn the framework first, you can learn it [here](https://learn.svelte.dev) or just [read the docs](https://svelte.dev/docs/kit/introduction).
60+
61+
<h3>Base Components</h3>
62+
63+
We used [**shadcn-svelte**](https://www.shadcn-svelte.com/) for the base components, we strongly recommended to use it for now, if you want to add components, just go [here](https://www.shadcn-svelte.com/docs/components/accordion).
64+
This is how you add **shadcn-svelte** component
2565

26-
#### Setup (for MySQL 8)
2766
```sh
28-
# Edit <username> and <password> with anything you want.
29-
sudo mysql -e "CREATE USER IF NOT EXISTS '<username>'@'%' IDENTIFIED BY '<password>';";
30-
sudo mysql -e "SET PASSWORD FOR '<username>'@'%' = '<password>';";
31-
sudo mysql -e "GRANT ALL ON *.* TO '<username>'@'%';";
32-
sudo mysql -e "FLUSH PRIVILEGES;";
33-
sudo mysql -e "CREATE DATABASE gnuweeb;";
34-
35-
# Make sure you have cd'ed to mail.gnuweeb.org;
36-
sudo mysql gnuweeb < database.sql;
67+
npx shadcn-svelte@latest add <component-name>
3768
```
3869

70+
After installed **shadcn-svelte** component, it will generated in [$lib/components/ui](./src/lib/components/ui/), if you want to have a small edit.
3971

40-
#### Setup (for MySQL 5.x and MariaDB)
41-
```sh
42-
# Edit <username> and <password> with anything you want.
72+
<h3>Custom Components</h3>
4373

44-
sudo mysql -e "GRANT ALL PRIVILEGES ON *.* TO '<username>'@'%' IDENTIFIED BY '<password>';";
45-
sudo mysql -e "FLUSH PRIVILEGES;";
46-
sudo mysql -e "CREATE DATABASE gnuweeb;";
74+
If you want to create your own custom components you can create it in [$lib/components/customs](./src/lib/components/customs/).
4775

48-
# Make sure you have cd'ed to mail.gnuweeb.org;
49-
sudo mysql gnuweeb < database.sql;
50-
```
76+
<h3>Static Files</h3>
5177

52-
### After the database is ready
53-
```sh
54-
# Make sure you have cd'ed to mail.gnuweeb.org;
55-
cp -v config.example.php config.php;
78+
All static files were stored in [./static/](./static/).
5679

57-
# Generate APP_KEY for config.php
58-
head -c 30 /dev/urandom | xxd -ps
80+
<h3>Page Routes</h3>
5981

60-
# Fix the config file, adjust with your database username/password.
61-
vim config.php;
82+
All pages are created in [./src/routes](./src/routes/) and all protected routes (login required) are created in [./src/routes/(protected)](<./src/routes/(protected)/>).
6283

63-
# Start the PHP server.
64-
php -S 0.0.0.0:8080 -t public/
65-
# And ready to develop!
66-
# Access from your browser http://127.0.0.1:8080
67-
```
84+
<h3>Hooks Functions</h3>
85+
86+
All hooks are created in [$lib/hooks](./src/lib/hooks/).
87+
88+
<h3>Form Schemas</h3>
89+
90+
All form schemas are created in [$lib/schemas](./src/lib/schemas/).
91+
92+
<h3>Constants</h3>
93+
94+
All constants data are created in [$constants](./src/lib/constants/).
95+
96+
<h3>Typings</h3>
97+
98+
All types are created in [$typings](./src/lib/typings/).
99+
100+
<h3>Utilities</h3>
101+
102+
All util or helper functions are created in [$utils](./src/lib/utilities/).
68103

104+
<h3>Styling</h3>
69105

70-
# Maintainer
71-
- Ammar Faizi (@ammarfaizi2)
106+
If you want to create styles or CSS that only affects inside its page or component just write it inside that file,
107+
if you want to create styles or CSS that affects globally you can write it in [./src/app.css](./src/app.css).
72108

109+
<h3>Aliases</h3>
73110

74-
# License
75-
This project is licensed under the GNU GPL 2.0 license.
111+
You may add some import aliases, you can edit it in [svelte.config.js](./svelte.config.js), we used `$` as import alias, you must follow our standards to remain consistency.

backup.php

Lines changed: 0 additions & 154 deletions
This file was deleted.

0 commit comments

Comments
 (0)