Skip to content

Commit

Permalink
Merge pull request #20 from scienmanas/web-functional
Browse files Browse the repository at this point in the history
Web functional
  • Loading branch information
scienmanas authored Aug 11, 2024
2 parents abb6278 + edee8d8 commit 8b9f694
Show file tree
Hide file tree
Showing 34 changed files with 873 additions and 500 deletions.
68 changes: 67 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,67 @@
Will shortly be updated
<div align="center">
<img src="" alt="Logo">
</div>

# 🔰 Certiailer

An all in one tool to generate certificates is mass and mail them. Moreover the certificates are generated with unique-id which can be verfied at **https://certimailer.xyz**

## Divisions

CertiMailer is an open source project with a website as well as script version. The whole project is divided into two division for differnt users:
- `Python Script`: For advanced user who want to use the codebase or make their own.
- `Web version`: A web version is made hosted on free tier of different services. Intended for normal users.

## 📚 Tech Stack

### Python Script

- Mailny python and its differnt libraries.

### Website
- **Client:** Next JS, TailwindCSS.
- **Server:** Node, Express.
- **Datebase:** Mongo DB, Google cloud storage bucket.



## 🔨 Setting Up

To set up the project locally, follow the steps mentioned in their respective folders (for `python script` and `web version`).

## ⚡ Features

- `Various News Types Supported:` World, General, Nation, Business, Technology, Entertainment, Sports, Science, Health.

- `Wide Range of Countries Supported:` India, Brazil, Canada, France, Japan, United States

## 📁 File Structure :

```
.
├── Website
│ │── Frontend
│ │ └── ... Necessaty files
│ │── Backend
│ │ └── ... Necessaty files
│ └── README.md
├── python script
│ │── ... Necessaty files
│ └── README.md
├── .gitignore
├── LICENSE
└── README.md
```
- For detail view of file structure for each part look into that specific part respectively.

## 🔥 Contributing

Contributions are always welcome! Additionally you can contact me by my email: **[email protected]**. There are many thinsg which can be improved, if you feel something needs to be added/modified raise an issue. Additionally if you want you can work on that issue too.

## 📷 Screenshots



## 🔒 License

This repository is open source and under [MIT](https://choosealicense.com/licenses/mit/) License.
Binary file added Website/Backend/Manas.pdf
Binary file not shown.
10 changes: 7 additions & 3 deletions Website/Backend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { connectToDB } from "./config/db";
// Routes import
import certificatesRoute from "./routes/certificate";
import authRoute from "./routes/auth";
import sendEmailsRoute from "./routes/sendEmails";
import UserRoute from "./routes/user";

// Load the env
config();
Expand All @@ -19,7 +21,7 @@ const PORT: string = process.env.PORT || "5000";
// CORS configuration
const corsConfiguration = {
origin: ["https://certimailer.xyz"],
// origin: ["*"],
// origin: "*",
optionSucessStatus: 200,
};

Expand All @@ -30,14 +32,16 @@ app.use(cors(corsConfiguration));
// Routes
app.use("/api/certificate", certificatesRoute);
app.use("/api/auth", authRoute);
app.use("/api/send-email", sendEmailsRoute);
app.use("/api/user", UserRoute);

// Landing endpoint
app.get("/", (req: Request, res: Response) => {
res.status(200).json({ message: "200 OK :)" });
res.status(200).json({ message: "200 OK Hello guys :)" });
});

// Listening at
app.listen(PORT, () => {
console.log(`Server active at port: ${PORT}`);
console.log(`Server active at: http://localhost:${PORT}`);
// console.log(`Server active at: http://localhost:${PORT}`);
});
10 changes: 10 additions & 0 deletions Website/Backend/lib/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@ export type certificatesParams = {
organization_id: string;
organization_status: string;
organization_email: string;
_id: string;
issued_to: string;
issued_email: string;
issued_date: string;
expiry_date: string;
};

export type waitlistParams = {
name: string;
email: string;
designation: string;
};

export type newsLetterParams = {
email: string;
};
12 changes: 12 additions & 0 deletions Website/Backend/models/newsletter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import mongoose from "mongoose";

const newsLetterSchema = new mongoose.Schema(
{
email: { type: String, required: true, unique: false }
},
{
collection: 'newsletter'
}
);

export default mongoose.models.newsLetter || mongoose.model('newsLetter', newsLetterSchema)
14 changes: 14 additions & 0 deletions Website/Backend/models/waitlist.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import mongoose from "mongoose";

const WaitListSchema = new mongoose.Schema(
{
name: { type: String, required: true },
designation: { type: String, required: true },
email: { type: String, required: true },
},
{
collection: ' waitlist' // collection in which the data is saved
}
);

export default mongoose.models.waitList || mongoose.model('waitUser', WaitListSchema)
Loading

0 comments on commit 8b9f694

Please sign in to comment.