Ovanda's Posts
Nairaland Forum › Ovanda's Profile › Ovanda's Posts
Dear esteemed members of Nairaland Programming section, I hope this message finds you well. As a dedicated and passionate PERN (PostgreSQL, Express, React, Node.js) stack developer, I've been an avid follower of this community for years. The wealth of knowledge, expertise, and camaraderie shared here has been instrumental in my growth and learning journey. With a strong foundation in PERN stack development and a keen interest in full-stack development, I'm eager to take my skills to the next level. However, I recognize the importance of real-world experience in bridging the gap between theoretical knowledge and practical application. This is where I humbly request your consideration for an unpaid internship within your esteemed organization. I understand the value of your time and expertise, and I'm willing to contribute my skills and dedication without expectation of compensation. Through this internship, I hope to: - Gain hands-on experience in full-stack development with a focus on PERN stack - Collaborate with experienced professionals and learn from their expertise - Contribute to meaningful projects and make a tangible impact - Enhance my problem-solving skills and adaptability in real-world scenarios In return, I offer: - Diligence, enthusiasm, and a willingness to learn - Strong work ethic and commitment to delivering quality results - Fresh perspectives and innovative ideas - Proficiency in PERN stack development, with a passion for building scalable and efficient applications I believe this opportunity would not only benefit me but also bring value to your organization. I'm confident that my dedication and eagerness to learn would make me a valuable asset to your team. Thank you for considering my appeal. I look forward to the opportunity to discuss this further and explore how I can contribute to your organization. Sincerely, Victor |
Full Stack intermediate 08035442507 |
Idiot,I blame you. |
DDayve:Bro abeg let's connect. I just need directions from you and I promise I won't disturb you. I just need to ask questions on Whatsapp from time to time. Answer at your leisure. Abeg? Here's my WhatsApp number 05835442507 |
Is this still ongoing?? |
Shomek:Guy na JavaScript you de refer to dismissively so? You build projects?? |
Shomek:React is all about JavaScript. You need to be grounded in JavaScript before you start with React. |
wittywriter:Bro, I'm interested in this. I can write. Here's my WhatsApp line 08035442507 |
BlindAngel:A simp spotted!!! |
You're welcome[/quote]Bros I don get am, finally and it's working like a beauty!! There should be two tables(eg, sessions and users) in one database (e.g., `mydb`). 1. `sessions` - used to store session data 2. `users` - used to store user data Both tables are stored in the same database, but they serve different purposes. The `sessions` table is used by the `express-session` middleware to store session data, while the `users` table is used to store user data for the CRUD operations. Having separate tables for sessions and users is a common practice, as it allows you to manage and query the data independently. This also helps to keep the data organized and scalable, especially in larger applications. Here's a high-level overview of how to use sessions and PostgreSQL in an Express CRUD application: *Sessions:* 1. Install `express-session` and `pg` packages: ``` npm install express-session pg ``` 1. Set up session middleware: ``` const session = require('express-session'); const pgSession = require('connect-pg-simple')(session); app.use(session({ store: new pgSession({ pool: new pg.Pool(/* your PostgreSQL connection settings */), tableName: 'sessions' }), secret: 'your_secret_key', resave: false, saveUninitialized: false, cookie: { secure: true } })); ``` *PostgreSQL:* 1. Install `pg` package: ``` npm install pg ``` 1. Create a PostgreSQL pool: ``` const { Pool } = require('pg'); const pool = new Pool({ user: 'your_username', host: 'your_host', database: 'your_database', password: 'your_password', port: 5432 }); ``` *CRUD Operations:* 1. Create a router for your CRUD endpoints: ``` const router = express.Router(); ``` 1. Define CRUD operations using the pool and session: ``` router.get('/users', async (req, res) => { const result = await pool.query('SELECT * FROM users'); req.session.users = result.rows; res.send(req.session.users); }); router.post('/users', async (req, res) => { const { name, email } = req.body; const result = await pool.query('INSERT INTO users (name, email) VALUES ($1, $2) RETURNING *', [name, email]); req.session.user = result.rows[0]; res.send(req.session.user); }); // ... ``` |
downbad:In essence, you no know, you no fit help. Thanks though. |
ovanda:Bro,I had wanted to get in touch with you because, being a PERN stack developer,I had a question I would have liked to get clarity on but as you no wan respond make I ask the question here. It's about authentication with session. You can store session in a mongoose database using the code below: const MongoStore = require('connect-mongo')(session) app.use(session( secret: 'SECRET KEY', resave: false, saveUninitialized: true, store: new MongoStore({ url: 'mongodb://localhost:27017/test-app', //YOUR MONGODB URL ttl: 14 * 24 * 60 * 60, autoRemove: 'native' }) )) Or something similar. You don't need to create tables where it is stored as is the case with Postgresql. To store a session in a postgresql, the code below is needed: import genFunc from 'connect-pg-simple'; const PostgresqlStore = genFunc(session); const sessionStore = new PostgresqlStore({ conString: '<insert-connection-string-here>', } app.use(session({ secret: 'secret', resave: false, saveUninitialized: false, cookie: cookieOptions, // define cookieOptions store: sessionStore })); I was able to successfully store a session inside a postgresql, using the code above. In Setting Up the Database First, I created a database called express-store-test (the name of the database doesn’t really matter). Then I added a table called session — express will automatically look for this table for finding the session data. This table has 3 columns, which are: sid is the session id — this is what cookies reference. sess: contains the session as a JSON object expire: contains the expiration timestamp for the current session My question is this? Assuming I am developing a crud application, would it have a new database with a different name or is there a way to build on the one I created for session? If I have to create a new database for my crud application, how do i Link it up with the one for session? |
Bros abeg, here's my line, I'd like to get in touch with you 08035442507 |
This is just beautiful! Bro i am learning PERN stack and I intend to develop a crud application soon. Abeg, how did you implement that next button at the very end of the website? |
Please can I have your email address? |
Good day everyone. My name is Victor and I need a mentor. I know I am good in programming but i keep going around in circles. I learned java and spring framework and could write meaningful program with it. Then someone pointed to PERN stack.i am through with react and all the JavaScript basics, though I know JavaScript to a good extent. I'm done with express js and I am tackling nodes js right now. I want to continue with this stack. The thing here is that I can learn any programming language fast and surmount any challenges as long as I have Google,lol. Please and please, just point me in the right direction,abeg. Thank you. |
Devdevdev please and please, i sent you a mail, respond. |
anslemarinze52:Na dem. |
I am interested in this. I am still learning pern stack but i am very good with Java j2se |
I know Java. You can reach me on WhatsApp 08035442507 |
I am good with Java 2se. 08035442507 |
On point. |
Englishisamust:Thank you very much. I am clear. |
Please seniors, pardon my ignorance. I keep hearing people saying they use documentation. What is documentation and how is it used? |
Its getting to one year now and I've not finished the full stack web development course i bought at codecademy and someone here is talking about 7 days. Does this individual actually know what a full stack web development is?? I guess not. |
AllenSpencer:This and circle theorem |
Guy nobody can write any meaningful code off head. I have 🐝 coding for years but you'd be surprised that sometimes i still go back to my text books to understand again something that is as simple as if else statement. |
To all of you supporting the so called anti coup movement, can't you see what france is doing Was it not reported the other day that France released terrorists they have been detaining in Niger?? Again, to the anti coup movement supporters, have you asked yourself why these terrorists were released?? It was reported some days back that France violeted Niger's Air space. Can they do that to any European country? Niger has severed ties with France and asked them to go yet they refused, why? Make Una the reason oh!! |
U am interested too |
Amarachi, a beautiful girl i fell in love with in 2006. I am married with a child but i still love that girl till this day. |
Was it not reported the other day that France released terrorists they have been detaining in Niger?? Again, to the anti coup movement supporters, have you asked yourself why these terrorists were released?? It was reported some days back that France violeted Niger's Air space. Can they do that to any European country? Niger has severed ties with France and asked them to go yet they refused, why? Make Una the reason oh!!